package logging

import (
	"os"
	"github.com/op/go-logging"
)
var log = logging.MustGetLogger("rrrmai")

func init() {
	logFile, err := os.OpenFile("/Users/os/gopath/log.txt", os.O_WRONLY,0666)
	if err != nil{
		log.Panic(err)
	}
	backend1 := logging.NewLogBackend(logFile, "", 0)
	// Only errors and more severe messages should be sent to backend1
	backend1Leveled := logging.AddModuleLevel(backend1)
	backend1Leveled.SetLevel(logging.ERROR, "")

	// Set the backends to be used.
	logging.SetBackend(backend1Leveled)
}

func GetLogging ()(*logging.Logger){
	return log
}
